<%@ page pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <c:url var="base" value="/" />
    <base href="${base}">
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        * {
            padding: 0;
            margin: 0;
            box-sizing: border-box;
        }
        .table {
            text-align: center;
        }
        .main {
            font-size: 14px;
            border-collapse: collapse;
            width: 70%;
            table-layout: fixed;
            text-align: center;
            line-height: 25px;
            margin:0 auto;
        }
        th {
            background-color: purple;
            color: white;
            border: dashed 1px #a59e9e;
            border-left: none;
            border-right: none;
        }
        td {
            border: dashed 1px #a59e9e;
            border-left: none;
            border-right: none;
        }
        a {
            background-color: plum;
            display: block;
            text-decoration: none;
            color: white;
        }
    </style>
</head>
<body>
<jsp:useBean id="teachers" scope="request" type="java.util.List<com.entity.Teacher>"/>
<div class="table">
    <table class="main">
        <tr>
            <th>#</th>
            <th>姓名</th>
            <th>注册时间</th>
        </tr>
        <c:forEach items="${teachers}" var="t" varStatus="ts">
            <tr>
                <td>${ts.count}</td>
                <td><a href="updateteacher?id=${t.id}"> ${t.name}</a></td>
                <td><fmt:formatDate pattern="yyyy-MM-dd HH:mm" value="${t.insertDate}" /></td>
            </tr>
        </c:forEach>
    </table>
</div>
</body>
</html>
